﻿@page
@model SourceStack.Pages.Problem.IndexModel
@{
    ViewData["Title"] = "首页.一起帮";
    int count = Convert.ToInt32(@ViewData["Count"]);
    int remainder = 0;
}
<h1>首页.一起帮</h1>
<form method="post" href="/Problem/Index">
    <label>标题：（*必填）</label>
    <input type="text" />

</form>
@foreach (var item in Model.Problems)
{
    <div>
        <small>@item.PublishTime.ToString("yyyy年mm月dd日 hh点mm分")</small>
        <h2><a href="/Article/Single?id=@item.Id">@item.Title</a></h2>
        <p>@item.Body</p>
    </div>
}
@if (count % 5 != 0)
{
    remainder = 1;
}
@for (int i = 0; i < (count / 5) + remainder; i++)
{
    <a href="/Problem?pageIndex=@(i+1)">@(i+1) </a>
}
